package com.accloud.cloudservice;

import com.accloud.service.ACException;
import org.json.JSONException;
import org.json.JSONObject;

/* access modifiers changed from: package-private */
public class ACEvent {
    final JSONObject data = new JSONObject();
    Long deviceId;
    final String name;
    String physicalDeviceId;
     JSONObject result = new JSONObject();
    String subDomain;

    ACEvent(String name2, String eventType, ACException exception) {
        this.name = name2;
        try {
            this.data.put("event_type", eventType);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        error(exception);
    }

    /* access modifiers changed from: package-private */
    public JSONObject getData() {
        return this.data;
    }

    public void error(ACException exception) {
        if (exception != null) {
            try {
                this.result.put("error_code", exception.getErrorCode());
                this.result.put("error", exception.getMessage());
                this.result.put("description", exception.getDescription());
            } catch (JSONException e) {
                e.printStackTrace();
            }
        } else {
//            this.result.put("error_code", 0);
        }
    }
}
